package com.xiao.service.impl;

import com.xiao.entity.Hotel;
import com.xiao.mapper.HotelMapper;
import com.xiao.req.SearchByConditionsReq;
import com.xiao.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Xiao
 * @version 1.0
 * @description
 * @date 2022/2/27 0:13
 */
@Service
public class HotelServiceImpl implements HotelService {

    @Autowired
    private HotelMapper hotelMapper;

    /**
     * 查询全部酒店数据
     * @return
     */
    @Override
    public List<Hotel> getAll() {
        return hotelMapper.getAll();
    }

    /**
     * 根据价格和品牌编号查找酒店数据
     * @param req
     * @return
     */
    @Override
    public List<Hotel> searchByConditions(SearchByConditionsReq req) {
        return hotelMapper.searchByConditions(req.getPrice(), req.getBrandCodes());
    }
}
